package com.example.demo.controller;

import com.example.demo.Mappers.GetRegDoctListMapper;
import com.example.demo.beans.GetRegDoctListRequest;
import com.example.demo.beans.GetRegDoctListResponse;
import com.example.demo.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Administrator on 2018/4/13.
 */
@RestController
public class GetRegDoctListController {
   @Autowired
   private GetRegDoctListMapper mapper;
    @ResponseBody
    @RequestMapping(value ="GetRegDoctList", produces = {"application/xml"} )
    public GetRegDoctListResponse  GetDoc(@RequestBody(required = false)GetRegDoctListRequest request){
     GetRegDoctListResponse response=new GetRegDoctListResponse();
        if(request!=null){
         response.setResultCode("0");
         response.setResultMsg("获取科室医生信息成功");
         response.setItems(mapper.getDocList(request.getDeptID(),request.getDay()));
    return response;
     }
     else {response.setResultCode("1");response.setResultMsg("请求参数为空");
        return  response;}
    }
}
